package org.stvd.repository.admin;

import java.util.List;
import java.util.Map;

import org.stvd.core.dto.QueryResult;
import org.stvd.entities.admin.Department;
import org.stvd.repository.base.BaseDao;

public interface DepartmentDao extends BaseDao<Department> {

    /**
     * 根据用户ID获取用户全部机构信息
     * @param userId 用户ID
     * @return
     */
    List<Department> findAllDepByUid(String userId);
    
    /**
     * 获取平台全部机构信息
     * @param guid 平台ID
     * @return
     */
    List<Department> findAllDepByGuid(String guid);
    
    List<Department> findImeDepartmentByJsm(String jsm, String guid);

    List<Department> findDepByUid(String userId, String guid);

    void insertUserDep(String userId, String depId, String guid);

    QueryResult<Department> getDepartmentQueryResult(int start, int limit, String depName, String guid);

    List<Department> getChildDepartment(String depId, String guid);

    List<Department> getAllChildDepartment(String depId, String guid);

    List<Department> findDepartmentByInnerCode(String innerCode, String guid);
    
    /**
     * 根据机构编码获取机构信息
     * @param depCode
     * @param guid
     * @return
     */
    Department getDepartmentByDepCode(String depCode, String guid);

    /**
     * 根据条件获取用户未分配的机构及平台信息
     * @param userId 用户ID
     * @param depCode 机构编码 
     * @return
     */
    List<Map<String, Object>> listUserNoneDepGuid(String userId, String depCode);
    
    /**
     * 根据平台GUID获取用户机构列表
     * @param guid 平台ID
     * @return
     */
    List<Map<String, Object>> listUserDepByGuid(String guid);

}
